/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 周斌
 * Date: 2024-04-11
 * Time: 21:57
 */
public class singleNumber {
    /*Set<Integer> set = new HashSet();
        for (int i = 0; i < nums.length; i++) {
        // 判断set集合中是否含有nums[i]
        if (!set.contains(nums[i])) {
            set.add(nums[i]);
        } else {
            set.remove(nums[i]);
        }
    }
    // 此时set集合中只剩下只出现了一次的元素
        for (int i = 0; i < nums.length; i++) {
        if (set.contains(nums[i])) {
            return nums[i];
        }
    }
        return -1;*/
}
